package com.znsd.zl.api.redis;

import com.znsd.zl.vo.req.RedisReqVO;
import com.znsd.zl.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName RedisFeignService
 * @Description redis服务远程调用接口
 * @Author jaypdd
 * @Date 2020/8/14 10:49
 * @Version v1.0
 */
@FeignClient("zlhouse-redis")
@RequestMapping("/redis")
public interface RedisFeignService {

	/**
	 * 添加普通key value缓存
	 * @param redisReqVO    set普通缓存vo请求对象
	 * @return 添加成功返回code:0 失败code: SC_INTERNAL_SERVER_ERROR状态码
	 */
	@PostMapping("/set")
	public R saveKeyValue(@RequestBody RedisReqVO redisReqVO);

	/**
	 * 通过key获取值
	 * @param key       key
	 * @return  获取成功返回data键值对value就是获取的对应值
	 */
	@GetMapping("/get")
	public R getValueByKey(@RequestParam("key") String key);
}
